﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FoundationLib.Ifc
{
	/// <summary>
	/// Provides methods for resolving paged data record lists.
	/// </summary>
	/// <typeparam name="T">The type of the paged data records</typeparam>
	public interface IPageResolver<T>
	{
		/// <summary>
		/// Gets the total number of records in the data source.
		/// </summary>
		int TotalItemCount
		{
			get;
		}

		/// <summary>
		/// Returns a the items on the page with the given index.
		/// </summary>
		/// <param name="pageIndex">The 1-based page index</param>
		/// <param name="pageSize">The maximum number of records per page</param>
		/// <returns>The paged data records of type <typeparamref name="T"/></returns>
		IEnumerable<T> GetPageItems(int pageIndex, int pageSize);
	}
}
